import request from '@/router/axios';

// 获取列表
export const getList = (current, size, params) => {
  return request({
    url: '/api/hg-equipment/accept/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

// 删除
export const remove = (id) => {
  return request({
    url: '/api/hg-equipment/accept/remove',
    method: 'post',
    params: {
      id
    }
  })
}

// 保存
export const save = (data,ids) => {
  return request({
    url: '/api/hg-equipment/accept/save',
    method: 'post',
    data: data,
    params: {
      ids
    }
  })
}

// 详情
export const detail = (id) => {
  return request({
    url: '/api/hg-equipment/accept/info',
    method: 'get',
    params: {
      id
    }
  })
}

// 提交设备验收单
export const commit = (id) => {
  return request({
    url: '/api/hg-equipment/accept/commit',
    method: 'get',
    params: {
      id
    }
  })
}

// 获取采购订单
export const getOrder = (current, size, params) => {
  return request({
    url: '/api/hg-equipment/accept/getOrder',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

// 校验初步验收是否已被选择
export const checkPre = (preAcceptNo) => {
  return request({
    url: '/api/hg-equipment/accept/checkPre',
    method: 'get',
    params: {
      preAcceptNo
    }
  })
}

// 校验是否存在初步验收
export const checkOrder = (materialNo,purchaseNo) => {
  return request({
    url: '/api/hg-equipment/accept/checkOrder',
    method: 'get',
    params: {
      materialNo,
      purchaseNo
    }
  })
}